public class lx_7_0921 {
         public static void print(int n){
        if(n>9){
            System.out.println(n%10);
            print(n/10);
        }else{
            System.out.println(n);
            return;
        }
    }

    public static int sum(int n){
        if(n==1){
            return 1;
        }else{
            return n+sum(n-1);
        }
    }

    public static void main(String[] args) {
        int m=9;
        int ret=sum(m);
        System.out.println(ret);
    }
}
